package com.zzyl.nursing.service.impl;

import java.util.List;
import com.zzyl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zzyl.nursing.mapper.VisitorMapper;
import com.zzyl.nursing.domain.Visitor;
import com.zzyl.nursing.service.IVisitorService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;
/**
 * 来访登记Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-09
 */
@Service
public class VisitorServiceImpl extends ServiceImpl<VisitorMapper,Visitor> implements IVisitorService
{
    @Autowired
    private VisitorMapper visitorMapper;

    /**
     * 查询来访登记
     * 
     * @param id 来访登记主键
     * @return 来访登记
     */
    @Override
    public Visitor selectVisitorById(Long id)
    {
        return getById(id);
    }

    /**
     * 查询来访登记列表
     * 
     * @param visitor 来访登记
     * @return 来访登记
     */
    @Override
    public List<Visitor> selectVisitorList(Visitor visitor)
    {
        return visitorMapper.selectVisitorList(visitor);
    }

    /**
     * 新增来访登记
     * 
     * @param visitor 来访登记
     * @return 结果
     */
    @Override
    public int insertVisitor(Visitor visitor)
    {
        return save(visitor)?1:0;
    }

    /**
     * 修改来访登记
     * 
     * @param visitor 来访登记
     * @return 结果
     */
    @Override
    public int updateVisitor(Visitor visitor)
    {
        return updateById(visitor)?1:0;
    }

    /**
     * 批量删除来访登记
     * 
     * @param ids 需要删除的来访登记主键
     * @return 结果
     */
    @Override
    public int deleteVisitorByIds(Long[] ids)
    {
        return removeByIds(Arrays.asList(ids))?1:0;
    }

    /**
     * 删除来访登记信息
     * 
     * @param id 来访登记主键
     * @return 结果
     */
    @Override
    public int deleteVisitorById(Long id)
    {
        return removeById(id)?1:0;
    }

}
